# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=niaaml-gui
_pkgorig=NiaAML-GUI
pkgver=0.2.1
pkgrel=0
pkgdesc="GUI for NiaAML Python package"
url="https://github.com/lukapecnik/NiaAML-GUI"
arch="noarch"
license="MIT"
depends="python3 py3-niapy py3-niaaml py3-qtawesome py3-qt6"
checkdepends="py3-pytest-xdist"
makedepends="py3-poetry-core py3-gpep517"
subpackages="$pkgname-doc $pkgname-pyc"
source="https://github.com/lukapecnik/NiaAML-GUI/archive/$pkgver/$_pkgorig-$pkgver.tar.gz"
builddir="$srcdir/NiaAML-GUI-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/niaaml_gui-$pkgver-py3-none-any.whl

	install -Dm644 AppData/io.github.lukapecnik.niaaml_gui.desktop "$pkgdir"/usr/share/applications/niaaml_gui.desktop
	install -Dm644 AppData/niaaml-gui.png "$pkgdir"/usr/share/icons/hicolor/256x256/apps/niaaml-gui.png

	install -Dm644 CITATION.cff -t "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
41516c7b91ef6e2da391b2db68ecb791914a18b582fd828965a1689e4d56f621085cd46d2c284d89a51159cf87112ae753bfe954544a07cbe3d1b9c59a4a0958  NiaAML-GUI-0.2.1.tar.gz
"
